# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Alexander Fehr <pizzapunk gmail com>

pkgname=desktop-file-utils
pkgver=0.23+4+g92af410
pkgrel=1
pkgdesc="Command line utilities for working with desktop entries"
arch=('x86_64')
url="https://www.freedesktop.org/wiki/Software/desktop-file-utils"
license=('GPL')
depends=('glib2')
makedepends=(git)
_commit=92af4108750ceaf4191fd54e255885c7d8a78b70  # master
source=("git+https://anongit.freedesktop.org/git/xdg/desktop-file-utils#commit=$_commit"
        update-desktop-database.hook)
sha256sums=('SKIP'
            '2be5efa6c93f89691d106c086ef392e5dbf2839e2de2afc43a7f616f55b2a81d')
validpgpkeys=('C01EDE5BB0D91E26D003662EC76BB9FEEAD12EA7') #Hans Petter Jansson <hpj@suse.com>

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

check() {
  cd $pkgname
  make check
}

build() {
  cd "${srcdir}/$pkgname"
  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}/$pkgname"
  make DESTDIR="${pkgdir}" install

  install -Dm644 "$srcdir"/update-desktop-database.hook "$pkgdir"/usr/share/libalpm/hooks/update-desktop-database.hook
}
